import React from 'react'
import {
    Container,
    Content,
    Grid
} from 'native-base'

import { ActivityIndicator } from 'antd-mobile'


class MainLayout extends React.Component {

    render() {
        const { loading } = this.props

        return (
            <Container>
                {this.props.children}

                {loading ? <Content contentContainerStyle={{ flex: 1 }}>
                    <Grid style={{ alignItems: 'center' }}>
                        <ActivityIndicator toast text="正在加载" />
                    </Grid>
                </Content> : null}
            </Container>
        )
    }
}

export default MainLayout
